//
//  HJDownloadManager.h
//  KaiChat
//
//  Created by lx on 2024/4/17.
//

#import <Foundation/Foundation.h>
#import "HJChatMessageModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface HJDownloadManager : NSObject

+ (HJDownloadManager *)downloadManager;


- (void)downloadTaskWithUrl:(NSString *)url destination:(NSString *)destination progress:(void (^)(int64_t completedUnitCount, int64_t totalUnitCount))downloadProgressBlock completionHandler:(void (^)(NSString *url, NSURL *filePath, NSError *error))completionHandler;
- (void)downloadTaskWithMessageModel:(HJChatMessageModel *)messageModel destination:(NSString *)destination progress:(void (^)(int64_t completedUnitCount, int64_t totalUnitCount))downloadProgressBlock completionHandler:(void (^)(NSString *url, NSURL *filePath, NSError *error))completionHandler;
- (void)cancelTaskWithUrl:(NSString *)url completionHandler:(void (^)(NSString *url, NSError *error))completionHandler;


@end

NS_ASSUME_NONNULL_END
